import request from "@/utils/request";

// 查询资产套件列表
export function listKits(query) {
  return request({
    url: "/admin/assets/kits/",
    method: "get",
    params: query
  });
}

// 查询资产表详细
export function getKits(id) {
  return request({
    url: "/admin/assets/kits/" + id + "/",
    method: "get"
  });
}

// 新增资产套件表
export function addKits(data) {
  return request({
    url: "/admin/assets/kits/",
    method: "post",
    data: data
  });
}

// 修改资产表
export function updateKits(data) {
  return request({
    url: "/admin/assets/kits/" + data.id + "/",
    method: "put",
    data: data
  });
}

// 删除资产套件表
export function delKits(id) {
  return request({
    url: "/admin/assets/kits/" + id + "/",
    method: "delete"
  });
}

// 导出资产表
export function exportAsset(query) {
  return request({
    url: "/admin/assets/kits/export",
    method: "get",
    params: query
  });
}

// 查询资产分类数据
export function getAssets(query) {
  return request({
    url: "/admin/assets/kits/getassets/",
    method: "get",
    params: query
  });
}

// 追加资产分类数据
export function addAssets(data) {
  return request({
    url: "/admin/assets/kits/addassets/",
    method: "post",
    data: data
  });
}

// 删除资产分类数据
export function deleteAssets(query) {
  return request({
    url: "/admin/assets/kits/delassets/",
    method: "delete",
    params: query
  });
}

// 套件借出
export function kitsCheckout(data) {
  return request({
    url: "/admin/assets/kitscheckout/",
    method: "post",
    data: data
  });
}

// 归还
export function componentCheckin(data) {
  return request({
    url: "/admin/assets/componentcheckin/",
    method: "post",
    data: data
  });
}

// 查询组件的借还记录
export function listComponentrecords(query) {
  return request({
    url: "/admin/assets/componentrecords/",
    method: "get",
    params: query
  });
}
